Workflow Parallel Template
The Workflow Parallel template demonstrates how a BindAI workflow can branch into multiple outgoing paths and synchronize those paths using a Join node. The Parallel node provides the branching point. The workflow executor schedules the outgoing nodes, while the Join node tracks how many branches have arrived before allowing execution to continue. This template introduces parallel branching and synchronization.Purpose
This template demonstrates how to:- create multiple workflow branches
- schedule independent workflow paths
- synchronize branches with a Join node
- use shared workflow context across branches
- coordinate independent operations
Workflow Structure
A typical parallel workflow looks like this:Execution Flow
The workflow first reaches the Parallel node:next_nodes.
Conceptually:
Parallel Node
A Parallel node can be created with:Independent Branches
Parallel branches are intended for operations that can progress independently. For example:Join Node
A Join node can synchronize the branches. It is configured with the number of expected arrivals:Synchronization
The Join node stores its arrival count in the shared workflow context. Conceptually:Waiting
If fewer branches have arrived than the configuredexpected value, the Join sets:
Shared Workflow Context
All branches use the workflow’s shared context. For example:Combining Results
The Join node does not combine or transform branch results. Its responsibility is synchronization. For example:result_a and result_b to produce a combined result.
Example
A simple multi-agent workflow could be structured as:Parallel vs Sequential
Parallel branching is useful when operations are independent.Sequential
Parallel
Error Handling
The Parallel and Join nodes do not implement their own branch-specific failure strategy. Node exceptions are handled by the workflow executor. If a retry policy is configured, the executor can retry a failing node until the configured retry limit is reached. If the node continues to fail and the retry policy is exhausted, normal workflow failure handling takes over. Therefore, this template should not imply that failed branches are automatically isolated or that successful branches are automatically converted into partial results.Related Workflow Features
Parallel workflows can be combined with other workflow features. For example:Typical Use Cases
This template is useful for:- multiple independent agents
- independent API operations
- separate document analysis
- multiple retrieval operations
- validation from different sources
- independent data preparation
- workflows that converge several results
Best Practices
- Use parallel branches only for independent operations.
- Use a Join when branches must synchronize.
- Set
expectedto the number of branch arrivals required. - Store branch-specific results in separate variables.
- Avoid conflicting writes to shared workflow variables.
- Keep dependent operations sequential.
- Use retry configuration for transient node failures.
- Remember that the Parallel node itself does not create separate workflow contexts.
- Keep branch structures simple and easy to maintain.
Summary
The Workflow Parallel template demonstrates BindAI’s parallel branching model. A Parallel node provides a branching point, while the workflow executor schedules its outgoing nodes. A Join node synchronizes the branches by counting arrivals against its configuredexpected value. Until the expected number of branches arrives, the Join places the workflow in a waiting state.
Branches share the workflow context, so separate output variables should be used when independent branches produce separate results.
This pattern provides a clear way to build branching workflows that later converge at a synchronization point.